#include "discountfactory.h"

DisCountFactory::DisCountFactory() {}

DisCount* DisCountFactory::buildInstance( )
{
    std::time_t now = std::time(nullptr);  // 获取当前时间（秒级时间戳）
    std::tm* localTime = std::localtime(&now);  // 转换为本地时间
    if( (localTime->tm_mon +1) == 5  && localTime->tm_mday == 1){
        return new Dis51Count();
    }else if( (localTime->tm_mon +1) == 6  && localTime->tm_mday == 1){
        return new Dis61Count();
    }
    return nullptr;
}
